package com.arraylist;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;

public class ArrayList_ {
    public static void main(String[] args) {
        ArrayList<Stu> stus = new ArrayList<>();
        Stu stu1 = new Stu("张三", 12, 88.8);
        Stu stu2 = new Stu("李四", 13, 66.6);
        Stu stu3 = new Stu("王五", 16, 77.6);

        stus.add(stu1);
        stus.add(stu2);
        stus.add(stu3);
        for(Stu stu:stus){
            System.out.println(stu);
        }

        System.out.println("=========sorted========");
        Collections.sort(stus);
        for(Stu stu:stus){
            System.out.println(stu);
        }

       /* String s1 = "welcome to bit";
        String s2 = "come ";

        ArrayList<Character> arr = new ArrayList<>();
        for (int i = 0; i < s1.length(); i++) {
            Character temp = s1.charAt(i);
            if (s2.contains(temp+"") == false) {
                arr.add(temp);
            }
        }
        System.out.println(arr);*/
    }
}
